<template>
  <div>
    <Header></Header>
    <router-view></router-view>
    <!-- 利用路由元信息解决组件的显示与隐藏问题 -->
    <Footer v-show="$route.meta.isShow"></Footer>
  </div>
</template>

<script>
import Header from "./components/Header";
import Footer from "./components/Footer";
export default {
  name: "App",
  components: {
    Header,
    Footer,
  },
  mounted() {
    //派发action，从而向服务器发送请求，获取三级联动数据
    this.$store.dispatch("home/getCategoryList");
  },
};
</script>